#include<stdio.h>
//int x=1;

//{
//  int x;
//  x = 1;
//}

int open(char* s/* file name*/, int mode);

int main(void){
  // 这是注释
  int x=1; // 这也是注释
  printf("// hello /* world */"); //注释会被编译器替换成空格

  printf("Hello\n");

  //占位符
  printf("There are %i apples\n", 3);
  printf("%s will come tonight\n","Jane");
  printf("%s says it is %i o'clock\n", "Ben", 21);
  printf("%5d\n", 123); // 输出为 "  123"
  printf("%-5d\n", 123); // 输出为 "123  "
  // 输出 "  123.450000"
  printf("%12f\n", 123.45);
  printf("%+d\n", 12); // 输出 +12
  printf("%+d\n", -12); // 输出 -12
  // 输出 Number is 0.50
  printf("Number is %.2f\n", 0.5);
  // 输出为 "  0.50"
  printf("%6.2f\n", 0.5);

  printf("%*.*f\n", 6, 2, 0.5);
  // 等同于
  printf("%6.2f\n", 0.5);

  printf("%.5s\n", "hello world");
}

